from machine import UART, Pin
import time

# 创建 UART 实例
uart = UART(1, baudrate=115200, tx=Pin(1), rx=Pin(0))  # UART1, TX是1号管脚，RX是0号管脚

# 无限循环读取
while True:
    if uart.any():
        data = uart.read()
        print('Received:', data)
    time.sleep(0.1)
